/**
 * output package name
 */
package com.kingdee.eas.minghua.trademanage.client;

import java.awt.event.*;
import java.util.Date;

import org.apache.log4j.Logger;

import com.kingdee.bos.metadata.entity.FilterInfo;
import com.kingdee.bos.metadata.entity.FilterItemInfo;
import com.kingdee.bos.metadata.query.util.CompareType;
import com.kingdee.bos.ui.face.CoreUIObject;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.eas.basedata.master.cssp.CustomerInfo;
import com.kingdee.eas.basedata.master.cssp.SupplierInfo;
import com.kingdee.eas.framework.*;

/**
 * output class name
 */
public class DownContractFilterUI extends AbstractDownContractFilterUI
{
    private static final Logger logger = CoreUIObject.getLogger(DownContractFilterUI.class);
    
    /**
     * output class constructor
     */
    public DownContractFilterUI() throws Exception
    {
        super();
        visaDate.setValue(null);
    }
    public FilterInfo getFilterInfo(){
    	FilterInfo filter=new FilterInfo();
    	if(htNumber.getText()!=null&&!"".equals(htNumber.getText().trim())){
    		filter.getFilterItems().add(new FilterItemInfo("number","%"+htNumber.getText()+"%",CompareType.LIKE));
    	}
    	if(htName.getText()!=null&&!"".equals(htName.getText().trim())){
    		filter.getFilterItems().add(new FilterItemInfo("name","%"+htName.getText()+"%",CompareType.LIKE));
    	}
    	if(visaDate.getValue()!=null){
    		Date applyDate = (Date) visaDate.getValue();
    		filter.getFilterItems().add(new FilterItemInfo("contractTime",applyDate,CompareType.EQUALS));
    	}
    	SupplierInfo sup=(SupplierInfo)supplier.getValue();
    	if(sup!=null){
    		filter.getFilterItems().add(new FilterItemInfo("downClient.id",sup.getId().toString(),CompareType.EQUALS));
    	}
    	return filter;
    }
    /**
     * output storeFields method
     */
    public void storeFields()
    {
        super.storeFields();
    }

}